<template>
	<view>
		<view class="helpTitle">{{ resultData.articleUrl }}</view>
		<!-- <view class="helpCon" v-html="resultData.content "></view> -->
		<div class="helpCon">
			<div class="product-img" v-html="resultData.content">
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				helpWordId: '',
				resultData: []
			};
		},
		onLoad(options) {
			this.helpWordId = options.helpWordId
			if (this.helpWordId) {
				this.getContent()
			}
		},
		methods: {
			getContent() {
				this.$Request.getT("/article/selectArticleById?articleId=" + this.helpWordId).then(res => {
					if (res.status == 0) {
						this.resultData = res.data;
						// 将你要渲染的数据进行字符串正则匹配
						this.resultData.content = this.resultData.content.replace(/<img/g,
							"<img style='max-width:100%;height:auto;'");
						uni.setNavigationBarTitle({
							title: res.data.title
						});
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				});
			}
		}
	};
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
	}

	.helpTitle {
		font-size: 40rpx;
		font-weight: bold;
		margin: 50rpx 30rpx 30rpx;
		color: #000;
	}

	// .helpCon {
	// 	font-size: 30rpx;
	// 	margin: 30rpx 30rpx 50rpx;
	// 	color: #000;
	// 	line-height: 2em;
	// }

	.helpCon {
		font-size: 30rpx;
		margin: 30rpx 30rpx 50rpx;
		background-size: 100%;
		width: 700rpx;
		line-height: 2em;

		.product-img {
			p img {
				width: 100% !important; //--------------------设置大小  添加!important
				height: auto !important;
			}
		}
	}
</style>
